#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
//	system("start https://www.lanqiao.cn/problems/7936/learning/");

	int n;
	n = 23;

	int ans = 0, t = 1;
	while (n) {
		ans += n % 2 * t;
		n /= 2;
		t *= 8;
	}
	cout << ans;

	return 0;
}
